from flask import Blueprint
from flask_restful import Api,Resource
from comment.utils.output import output_json

index_bp=Blueprint('index',__name__,url_prefix='/index')
index_api=Api(index_bp)
#定义json输出格式
index_api.representation('application/json')(output_json)

#导入资源
from Shopping.resources.index.index_resource import Shopping_Category,Dict_test,Shopping_Home_NewProduct,HomeRecommendProduct,Shopping_RecommendSubject
index_api.add_resource(Shopping_Category,'/category',endpoint='category')
index_api.add_resource(Dict_test,'/dict',endpoint='dict')#用于测试函数的资源类
index_api.add_resource(Shopping_Home_NewProduct,'/home_new_product',endpoint='home_new_product')#新品推荐
index_api.add_resource(HomeRecommendProduct,'/home_recommend_product',endpoint='home_recommend_product  ')#人气热搜
index_api.add_resource(Shopping_RecommendSubject,'/recommend_subject',endpoint='shopping_RecommendSubject')#专题广场
